﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace MinoChat.Ui.Controls;

// 带输入提示的TextBox控件
public class HintTextBox : TextBox
{
    static HintTextBox()
    {
        DefaultStyleKeyProperty.OverrideMetadata(typeof(HintTextBox),
            new FrameworkPropertyMetadata(typeof(HintTextBox)));
    }
    public static readonly DependencyProperty HintTextProperty =
        DependencyProperty.Register(
            nameof(HintText),
            typeof(string),
            typeof(HintTextBox),
            new PropertyMetadata(string.Empty));

    public static readonly DependencyProperty HintForegroundProperty =
        DependencyProperty.Register(
            nameof(HintForeground),
            typeof(Brush),
            typeof(HintTextBox),
            new PropertyMetadata(Brushes.Gray));

    // 输入提示文本
    public string HintText
    {
        get => (string)GetValue(HintTextProperty);
        set => SetValue(HintTextProperty, value);
    }

    // 提示文本颜色
    public Brush HintForeground
    {
        get => (Brush)GetValue(HintForegroundProperty);
        set => SetValue(HintForegroundProperty, value);
    }


}

